home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 352_01 / strppchc.cpp < prev    next >
C/C++ Source or Header  |  1991-04-22  |  553b  |  24 lines

  1. // STRPPCHC.CPP - module contains String::chrcmp()
  2. //        This routine compares two characters, testing for case sensitivity first
  3. //
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <alloc.h>
  7. #include <iostream.h>
  8. #include <ctype.h>
  9.  
  10. #include "dblib.h"
  11.  
  12. // NOTE: routine declared static in class {}. No 'this' ptr.        
  13. int String::chrcmp ( char a, char b )
  14.     // compare two characters, testing for case sensitivity.
  15.     {
  16.     if ( ! String::caseSens )
  17.         {
  18.         a = toupper (a);
  19.         b = toupper (b);
  20.         }
  21.     return a-b;
  22.     }            // end String::chrcmp()
  23.  
  24.